# -*- coding: utf-8 -*-
# !/usr/bin/env python
from rest_framework.views import APIView

from components.models import ResourceUser
from components.resource_management.resource_user.dao import query_resource_user
from utils.views import Result

class ResourceUsers(APIView):
    def get(self, request):
        data = request.query_params.copy()
        if isinstance(data['resource_user_ids'], str):
            data['resource_user_ids'] = [data['resource_user_ids']]

        resource_list = query_resource_user(data['resource_user_ids'])
        return Result.success_response(data=resource_list, msg='查询成功')


